package basics.jvm;

/**
 * 并发问题 - 同时操作导致错误结果
 * @author or2
 * @date 2021/7/15 9:37
 */
public class ConcurTest {

    private static int count = 0;

    public static void main(String[] args) {
        for (int i = 0; i < 10; i++) {
            new Thread(() -> {
                for (int j = 0; j < 1000; j++) {
                    count++;
                    System.out.println(count);
                }
            }).start();
        }
        System.out.println(count);
    }
}
